package xworker.gluon.attach;

import com.gluonhq.attach.device.DeviceService;
import org.xmeta.ActionContext;

public class DeviceActions {
    public static String getModel(ActionContext actionContext){
        DeviceService service = DeviceService.create().orElse(null);
        if(service != null){
            return service.getModel();
        }else{
            return null;
        }
    }

    public static String getPlatform(ActionContext actionContext){
        DeviceService service = DeviceService.create().orElse(null);
        if(service != null){
            return service.getPlatform();
        }else{
            return null;
        }
    }

    public static String getUuid(ActionContext actionContext){
        DeviceService service = DeviceService.create().orElse(null);
        if(service != null){
            return service.getUuid();
        }else{
            return null;
        }
    }

    public static String getVersion(ActionContext actionContext){
        DeviceService service = DeviceService.create().orElse(null);
        if(service != null){
            return service.getVersion();
        }else{
            return null;
        }
    }

    public static boolean isWearable(ActionContext actionContext){
        DeviceService service = DeviceService.create().orElse(null);
        if(service != null){
            return service.isWearable();
        }else{
            return false;
        }
    }
}
